module.exports = app => {
  const { STRING, INTEGER, DATE, Sequelize } = app.Sequelize;
  return app.model.define(
    'student',
    {
      stu_id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      account_id: { type: INTEGER },
      class_id: { type: INTEGER },
      stu_name: { type: STRING,allowNull: true },
      stu_number: {type: STRING, allowNull: true},
      grade: { type: STRING, allowNull: true },
      sex: { type: INTEGER, allowNull: true },
      birthday: { type: STRING, allowNull: true },
      age: { type: INTEGER, allowNull: true },
      major: { type: STRING, allowNull: true },
      department: { type: STRING, allowNull: true },
      class_name: { type: STRING, allowNull: true },
      enrollment_date: { type: STRING, allowNull: true },
      phone: { type: STRING, allowNull: true },
      email: { type: STRING, allowNull: true },
      address: { type: STRING, allowNull: true },
      create_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
      update_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
    },
    {
      freezeTableName: true,
      timestamps: false,
      underscored: true,
    },
  );
};
